1.Print quality table as requested in scenario:
Case rates by month for different regions within the EU.
summary_table1<- joined_df%>%
group_by(sub_region, month_rep)%>%
summarise(total_case_region= sum(total_conf_case))%>%
mutate(monthly_cases_per_region= sum(total_case_region),
MPX_cases_rate_per_region =
round( total_case_region/monthly_cases_per_region*100,1))%>%
arrange(sub_region, desc(month_rep))
## `summarise()` has grouped output by 'sub_region'. You can override using the
## `.groups` argument.
kable(summary_table1,
booktabs=T,
col.names=c("EU Regions", "Months MPX cases reported", "MPX cases",
"Total MPX cases per region",
"MPX cases rate per month per region"),
align='lcccc',
caption="MonkeyPox Rates per month for different regions within the EU in 2022",
format.args=list(big.mark=","))
| EU Regions | Months MPX cases reported | MPX cases | Total MPX cases per region | MPX cases rate per month per region |
|---|---|---|---|---|
| Eastern Europe | May | 5 | 277 | 1.8 |
| Eastern Europe | June | 58 | 277 | 20.9 |
| Eastern Europe | July | 116 | 277 | 41.9 |
| Eastern Europe | August | 98 | 277 | 35.4 |
| Northern Europe | May | 16 | 576 | 2.8 |
| Northern Europe | June | 117 | 576 | 20.3 |
| Northern Europe | July | 246 | 576 | 42.7 |
| Northern Europe | August | 197 | 576 | 34.2 |
| Southern Europe | May | 422 | 7,906 | 5.3 |
| Southern Europe | June | 1,902 | 7,906 | 24.1 |
| Southern Europe | July | 3,773 | 7,906 | 47.7 |
| Southern Europe | August | 1,809 | 7,906 | 22.9 |
| Western Europe | May | 131 | 8,257 | 1.6 |
| Western Europe | June | 2,040 | 8,257 | 24.7 |
| Western Europe | July | 4,134 | 8,257 | 50.1 |
| Western Europe | August | 1,952 | 8,257 | 23.6 |
1.1 Print quality plot or chart as requested in scenario
summary_table1$month_rep<- factor(summary_table1$month_rep)
summary_table1 %>%
ggplot(aes( x=sub_region, y= MPX_cases_rate_per_region,fill=month_rep)) +
geom_bar(position="dodge",stat="identity")+
labs(x = "EU Regions", y = "MonkeyPox Cases Rate")+
ggtitle("Dodged bar chart of monkeypox case rates by
month for different regions within the EU")
Interpretation:
1.2 Print quality plot or chart as requested in scenario
#make a presentable table
plot_ly(
summary_table1,
x=~ month_rep,
y=~MPX_cases_rate_per_region,
color=~sub_region,
type="scatter",
mode="lines",
colors=c("darkorange","darkcyan","darkslateblue", "darkred")
#text = ~paste('Cases: ',cases,'<br>Population: ',population,'<br>Rate: ',rate)
) %>%
layout(
title="Alameda County STD Rates, 2001-2018",
yaxis=list(title="Case Rate per 100,000"),
xaxis=list(title="Year"),
paper_bgcolor="azure",
plot_bgcolor="white"
)
## Warning: `arrange_()` was deprecated in dplyr 0.7.0.
## Please use `arrange()` instead.
## See vignette('programming') for more help
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was generated.
female_summary<- total_dataset%>%
mutate(mpx_rate = round(total_mpx_case/ sum(sex_female) *100,2))%>%
select(country_code, total_mpx_case, sex_female, mpx_rate)%>%
rename(female_population = sex_female)
female_summary
scatter_plot <- ggplot(data = female_summary, aes(x = female_population,
y = mpx_rate)) +
geom_point(na.rm=TRUE) + theme_minimal(base_size = 15)+
labs(x = " Total Number of females",
y = "Total number of MonkeyPox cases",
title ="Relationship between MonkeyPox cases and
Numbers of females within EU")
scatter_plot
Interpretation:
male_summary<- total_dataset%>%
mutate(mpx_rate = round(total_mpx_case/ sum(sex_male) *100,2))%>%
select(country_code, total_mpx_case, sex_male, mpx_rate)%>%
rename(male_population = sex_male)
female_summary
scatter_plot <- ggplot(data = male_summary, aes(x = male_population,
y = mpx_rate)) +
geom_point(na.rm=TRUE) + theme_minimal(base_size = 15)+
labs(x = " Total Number of males",
y = "Total number of MonkeyPox cases",
title ="Relationship between MonkeyPox cases and
Numbers of males within EU")
scatter_plot